From 3ef59a85411eb7391876bed6f5c7541126e2de25 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Mon, 29 Jul 2019 06:36:24 +0200 Subject: [PATCH] xen: don't longjmp() after domain_crash() in check_wakeup_from_wait() Continuing on the stack saved by __prepare_to_wait() on the wrong cpu is rather dangerous. Instead of doing so just call the scheduler again as it already is happening in the similar case in __prepare_to_wait() when doing the setjmp() would be wrong. Signed-off-by: Juergen Gross Reviewed-by: Andrew Cooper --- xen/common/wait.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/common/wait.c b/xen/common/wait.c index 3fc5f68611..24716e7676 100644 --- a/xen/common/wait.c +++ b/xen/common/wait.c @@ -196,6 +196,11 @@ void check_wakeup_from_wait(void) { gdprintk(XENLOG_ERR, "vcpu affinity lost\n"); domain_crash(curr->domain); + + /* Re-initiate scheduler and don't longjmp(). */ + raise_softirq(SCHEDULE_SOFTIRQ); + for ( ; ; ) + do_softirq(); } /* -- 2.30.2